<h2><?= $this->translate('Listing news');?></h2>
<div class="grid_12"><?= $this->flashMessenger(); ?></div>
<div class="clearfix"></div>
<p><a href="<?= $this->url(array(), 'news_news_create'); ?>"><?= $this->translate('Create a new news');?></a></p>
<div class="grid_12 alpha omega">
	<table width="100%">
		<thead>
			<tr>
				<th><?= $this->translate('ID');?></th>
				<th><?= $this->translate('Name');?></th>
				<th><?= $this->translate('Published');?></th>
				<th><?= $this->translate('Anonce');?></th>
				<th><?= $this->translate('Created at');?></th>
				<th><?= $this->translate('Updated at');?></th>
				<th><?= $this->translate('Actions');?></th>
			</tr>
		</thead>
		<tbody>
			<?php if($this->news->count() > 0):?>
				<?php foreach ($this->news as $news):?>
					<tr>
						<td style="text-align:center;">
							<?= $news->id;?>
						</td>
						<td style="text-align:center;">
							<?= $news->Translation[$this->LANG]->name;?>
						</td>
						<td style="text-align:center;">
							<?= $this->IconPublished($news->published);?>
						</td>
						<td>
							<?= substr(strip_tags($news->Translation[$this->LANG]->anonce), 0, 120);?>
						</td>
						<td style="text-align:center;">
							<?= date("d.m.Y H:i", $news->created_at);?>
						</td>
						<td style="text-align:center;">
							<?= date("d.m.Y H:i", $news->updated_at);?>
						</td>
						<td style="text-align:center;">
							<a href="<?= $this->url(array('id' => $news->id), 'news_news_update');?>">
								<?= $this->translate('Edit');?>
							</a>&nbsp;|&nbsp;
							<a href="<?= $this->url(array('id' => $news->id), 'news_news_delete');?>" onclick="return confirm('<?= $this->translate('Are you shure?');?>');">
								<?= $this->translate('Delete');?>
							</a>
						</td>
					</tr>
				<?php endforeach;?>
			<?php else: ?>
				<tr>
					<td colspan="7">
						<?= $this->translate('No items news');?>
					</td>
				</tr>
			<?php endif; ?>
		</tbody>
	</table>
</div>